<?php
   $downloadType_result = mysql_query("select id,name from download_type where flag =1");
   
   while($downloadType_row = mysql_fetch_array($downloadType_result))
   {
?>
		<option value="<?php echo $downloadType_row['id'];?>" <?php if($type_id==$downloadType_row['id']){echo "selected";}?>><?php echo $downloadType_row['name'];?></option>
<?php
   }
?>